Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script> function lighton() { document.getElementById('myimage').src = "bulbon.gif"; } function lightoff() { document.getElementById('myimage').src = "bulboff.gif"; } </script> </head> <body> <img id="myimage" onmousedown="lighton()" onmouseup="lightoff()" src="bulboff.gif" width="100" height="180" /> <p>Click mouse and hold down!</p> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_event_onmousedown by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:36:32 GMT --> </html>
Result:
Try it Yourself - © w3schools.com